﻿// Copyright (c)  MOKEYISH. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using System;
using NSQL.Expressions.Functions;

namespace NSQL.Expressions
{
    public class IntervalExpression : BaseExpression, IIntervalExpression
    {
        public long Interval { get; set; }
        public IntervalType Type { get; set; }

        private IntervalExpression(long interval, IntervalType type)
        {
            Interval = interval;
            Type = type;
        }

        public override T Accept<T>(IExpressionVisitor<T> visitor)
        {
            throw new System.NotImplementedException();
        }

        public static IntervalExpression FromYears(long years)
        {
            return new IntervalExpression(years, IntervalType.Years);
        }

        public static IntervalExpression FromMonths(long months)
        {
            return new IntervalExpression(months, IntervalType.Months);
        }

        public static IntervalExpression FromDays(long days)
        {
            return new IntervalExpression(days, IntervalType.Days);
        }

        public static IntervalExpression FromHours(long hours)
        {
            return new IntervalExpression(hours, IntervalType.Hours);
        }

        public static IntervalExpression FromMinutes(long minutes)
        {
            return new IntervalExpression(minutes, IntervalType.Minutes);
        }

        public static IntervalExpression FromSeconds(long seconds)
        {
            return new IntervalExpression(seconds, IntervalType.Seconds);
        }
    }
}